/**
 * Created by biyajuan on 2017/2/27.
 */
window.CONFIG = {
    API_URL: "http://api.huoyanzichan.com",
    SUCC_CODE: "0"
};

window.VERIFY_CODE = {
    TYPE_SIGNUP: "4",
};

window.RET_CODE = {
    CUSTOMER_MOBILE_EXIST: "122"
};

//获取url中的参数
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if (r != null) return unescape(r[2]); return null; //返回参数值
}

function alert(msg){
    /*var html = "<div style='width:80%;position:absolute;margin-left: 30%;top: 40%;'>\n\
     <div class='maibei-aui-toast' style='height:40px;width:95%;line-height: 40px;background-color:black;border-radius:14px;color:#fff;opacity:0.8;border:black;text-align:center;z-index:99999;position:relative;'>"+msg+"</div>\n\
     </div>";*/
    var html = "<div class='aui-tips aui-margin-b-15' id='maibei-alert' style='width: 80%;margin: -50% 10%;text-align: center;border-radius: 0.2rem;height: auto;'>"+
                    "<span class='aui-tips-title' style='margin: auto; height: auto'>"+msg+"</span>"+
                "</div>";
    $("body").append(html);
    $("#maibei-alert").fadeIn("slow");
    setTimeout("hidden_alert()",2000);
}
function maibei_alert(msg, show_time){
    /*var html = "<div style='width:80%;position:absolute;margin-left: 30%;top: 40%;'>\n\
     <div class='alert' style='height:40px;width:95%;line-height: 40px;background-color:black;border-radius:14px;color:#fff;opacity:0.8;border:black;text-align:center;z-index:99999;position:relative;'>"+msg+"</div>\n\
     </div>";*/
    var html = "<div class='aui-tips aui-margin-b-15' id='maibei-alert' style='width: 80%;margin: -50% 10%;text-align: center;border-radius: 0.2rem;height: auto;'>"+
        "<span class='aui-tips-title' style='margin: auto; height: auto'>"+msg+"</span>"+
        "</div>";
    $("body").append(html);
    $("#maibei-alert").fadeIn("slow");
    setTimeout("hidden_alert()",show_time);
}
function hidden_alert(){
    $("#maibei-alert").fadeOut("slow").remove();
}